package com.jl.jlapp.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jl.jlapp.R;
import com.jl.jlapp.eneity.OrderListModel.ResultDataBean;
import com.jl.jlapp.eneity.OrderListModel.ResultDataBean.OrderDetailsBean;

import java.util.List;

public class CenterAdapter
        extends BaseQuickAdapter<ResultDataBean, BaseViewHolder> {
    public CenterAdapter(int paramInt, @Nullable List<ResultDataBean> paramList) {
        super(paramInt, paramList);
    }

    @Override
    protected void convert(BaseViewHolder paramBaseViewHolder, ResultDataBean paramResultDataBean) {
        ((TextView) paramBaseViewHolder.getView(R.id.my_order_item_bottom_btn2)).setVisibility(View.GONE);
        paramBaseViewHolder.setText(R.id.my_order_no, paramResultDataBean.getOrderNo());
        switch (paramResultDataBean.getOrderState()) {
        }

        ImageView localImageView = (ImageView) paramBaseViewHolder.getView(R.id.goods_img);
        Glide.with(paramBaseViewHolder.itemView.getContext()).asBitmap().apply(new RequestOptions().placeholder(R.drawable.img_noimg_xs).error(R.drawable.img_lose_xs)).load("http://117.158.178.202:8001/JLMIS/" + ((OrderDetailsBean) paramResultDataBean.getOrderDetails().get(0)).getGoodsCoverUrl()).into(localImageView);
        paramBaseViewHolder.setText(R.id.goods_name, ((OrderDetailsBean) paramResultDataBean.getOrderDetails().get(0)).getGoodsName());
        paramBaseViewHolder.setText(R.id.goods_price, ((OrderDetailsBean) paramResultDataBean.getOrderDetails().get(0)).getGoodsOriginalPrice() + "");
        paramBaseViewHolder.setText(R.id.my_order_goods_specification, ((OrderDetailsBean) paramResultDataBean.getOrderDetails().get(0)).getGoodsSpecificationName());
        paramBaseViewHolder.setText(R.id.my_order_goods_num, ((OrderDetailsBean) paramResultDataBean.getOrderDetails().get(0)).getGoodsQuantity() + "");
        paramBaseViewHolder.setText(R.id.my_order_freight, paramResultDataBean.getPostage() + "");
        paramBaseViewHolder.setText(R.id.my_order_combined_num, paramResultDataBean.getOrderPresentPrice() + paramResultDataBean.getPostage() + "");
        int j = 0;
        int i = 0;
        while (i < paramResultDataBean.getOrderDetails().size()) {
            j += ((OrderDetailsBean) paramResultDataBean.getOrderDetails().get(i)).getGoodsQuantity();
            i += 1;
        }
        paramBaseViewHolder.setText(R.id.my_order_state, R.string.has_been_completed);
        if (paramResultDataBean.getIsHasEvaluation() == 0) {
            paramBaseViewHolder.setText(R.id.my_order_item_bottom_btn1, R.string.evaluation_of_printing);
        } else if (paramResultDataBean.getIsHasEvaluation() == 1) {
            paramBaseViewHolder.setText(R.id.my_order_item_bottom_btn1, R.string.evaluation_detail);
            paramBaseViewHolder.setText(R.id.my_order_state, R.string.has_been_completed);
            if (paramResultDataBean.getIsHasEvaluation() == 0) {
                paramBaseViewHolder.setText(R.id.my_order_item_bottom_btn1, R.string.evaluation_of_printing);
            } else if (paramResultDataBean.getIsHasEvaluation() == 1) {
                paramBaseViewHolder.setText(R.id.my_order_item_bottom_btn1, R.string.evaluation_detail);
                paramBaseViewHolder.setText(R.id.my_order_state, R.string.has_been_completed);
                if (paramResultDataBean.getIsHasEvaluation() == 0) {
                    paramBaseViewHolder.setText(R.id.my_order_item_bottom_btn1, R.string.evaluation_of_printing);
                } else if (paramResultDataBean.getIsHasEvaluation() == 1) {
                    paramBaseViewHolder.setText(R.id.my_order_item_bottom_btn1, R.string.evaluation_detail);
                }
            }
        }
        paramBaseViewHolder.setText(R.id.my_order_combined_goods_num, j + "");
        paramBaseViewHolder.addOnClickListener(R.id.my_order_item_bottom_btn1);
    }
}


/* Location:              /Users/davidzhang/Documents/decompileApk/jlfood-dex2jar.jar!/com/jl/jlapp/adapter/CenterAdapter.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */